var mysql = require('mysql');
let constdefine = require('../constDefine');

var connection = mysql.createConnection({
    host: constdefine.db_host,
    port: constdefine.db_port,
    user: constdefine.db_user_name,
    password: constdefine.db_user_password,
    database: constdefine.db_name,
    charset: 'utf8_general_ci'
});

connection.connect(function (err) {
    if (err) {
        throw err
    }
    console.log('database connection success');
    console.log('----------------------------');
});

module.exports = connection;